*************************************************************************
*** Capturing Incumbent Leaders during Coups d’État and How to Prevent It
*** Austin S. Matthews
*** Replication Files
*************************************************************************


****************
*** Prepare data
****************

import excel "/Users/austinmatthews/Library/CloudStorage/OneDrive-EastCarolinaUniversity/Under review/Paper - Capture and PGs/Capture and PGs - data.xlsx", sheet("Sheet1") firstrow

destring, replace


**********************
*Table 1: main results
**********************

logit pt_lagsuccess pt_lagcapture, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


********************
*Substantive effects
********************

***Figure 2: success substantive effects

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev pt_lagsince spline2 spline3 coldwar, vce (cl ccode)

margins, at (pt_lagcapture=(0,1)) vsquish
marginsplot, level(95) scheme(lean1)

***Figure 3: capture substantive effects

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)

margins, at (cw_pg=(0,1)) vsquish
marginsplot, level(95) scheme(lean1)

margins, at (cw_pg=(0,1) pt_laggeneral = (0,1)) vsquish


************************************
*** Table A1: Descriptive statistics
************************************
ta
sum pt_lagsuccess pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev pt_lagsince coldwar lcbcount


***********************************************
*** Table A2: main models w/ year fixed effects
***********************************************

logit pt_lagsuccess pt_lagcapture i.year, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar i.year, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount i.year, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg i.year if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar i.year if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount i.year if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


**************************************************
*** Table A3: main models w/ country fixed effects
**************************************************

logit pt_lagsuccess pt_lagcapture i.ccode, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar i.ccode, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount i.ccode, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg i.ccode if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar i.ccode if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount i.ccode if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


************************************************
*** Table A4: Main models w/ Colpus coups sample
************************************************

logit chin_lagsuccess colpus_CHlagcapture, vce (cl ccode)
outreg2 using table11, replace

logit chin_lagsuccess colpus_CHlagcapture colpus_CHlaggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.colpus_sinceCH##c.colpus_sinceCH##c.colpus_sinceCH coldwar, vce (cl ccode)
outreg2 using table11

logit chin_lagsuccess colpus_CHlagcapture colpus_CHlaggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.colpus_sinceCH##c.colpus_sinceCH##c.colpus_sinceCH coldwar lcbcount, vce (cl ccode)
outreg2 using table11

logit colpus_CHlagcapture cw_pg if colpus_CHlagstartabroad == "In Country" & colpus_CHpguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit colpus_CHlagcapture cw_pg colpus_CHlaggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.colpus_sinceCH##c.colpus_sinceCH##c.colpus_sinceCH coldwar if colpus_CHlagstartabroad == "In Country" & colpus_CHpguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit colpus_CHlagcapture cw_pg colpus_CHlaggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.colpus_sinceCH##c.colpus_sinceCH##c.colpus_sinceCH coldwar lcbcount if colpus_CHlagstartabroad == "In Country" & colpus_CHpguninvolved == 1, vce (cl ccode)
outreg2 using table11


************************************************
*** Table A5: Main models w/ PG in success model
************************************************

logit pt_lagsuccess pt_lagcapture, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


*************************************************
*** Table A6: Main models w/ military cab control
*************************************************

logit pt_lagsuccess pt_lagcapture white_milcabshare, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar white_milcabshare, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount white_milcabshare, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg white_milcabshare if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar white_milcabshare if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount white_milcabshare if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


**************************************
*** Table A7: Main models w/o Cold War
**************************************

logit pt_lagsuccess pt_lagcapture, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince lcbcount, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince lcbcount if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11


**************************************************
*** Table A8: Models w/ continuous democracy index
**************************************************

logit pt_lagsuccess pt_lagcapture, vce (cl ccode)
outreg2 using table11, replace

logit pt_lagsuccess pt_lagcapture pt_laggeneral p5v2018 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar, vce (cl ccode)
outreg2 using table11

logit pt_lagsuccess pt_lagcapture pt_laggeneral p5v2018 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral p5v2018 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

logit pt_lagcapture cw_pg pt_laggeneral p5v2018 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount if pt_lagldrstartlocation == "In Country" & pt_pguninvolved == 1, vce (cl ccode)
outreg2 using table11

************************************************************
*** Table A9: Heckman selection model of attempt and capture
************************************************************

drop if pt_lagldrstartlocation == "Abroad"

drop if pt_pguninvolved == 0

heckprob pt_lagcapture cw_pg dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount, vce (cl ccode) sel(pt_lagattempt=cw_pg dem6 lsoqual lmilper lngdppc chgdp recent_rev c.pt_lagsince##c.pt_lagsince##c.pt_lagsince coldwar lcbcount)

